const Router=require('koa-router'),
      router=new Router(),
      {user}=require('../models');

router.prefix('/api/users');//相当于发请求/api/users/+下面的路由


router.post('/login',async ctx=>{
  let {email,password}=ctx.request.body;

  ctx.body=await user.login(email,password);
});

router.post('/signup',async ctx=>{
  let {email,password}=ctx.request.body;

  ctx.body=await user.signup(email,password);
});

module.exports=router;





